﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ZFMaster.Master"  
    AutoEventWireup="true" CodeBehind="pub.aspx.cs" Inherits="ZF.WS.info.pub" %>

<%@ Register Src="/UserControls/SWFUpLoad.ascx" TagName="SWFUpLoad" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <link href="/css/validator.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   

    <script>
        var citystr = '<%=Newtonsoft.Json.JsonConvert.SerializeObject(ZF.BLL.DictionaryConfig.HAreaTree)%>';
    </script>

    <script language="javascript" type="text/javascript" src="/js/jqPlugins/jquery.json-2.2.min.js"></script>

    <script src="/js/formValidator.js" type="text/javascript" language="javascript"></script>

    <script src="/js/formValidatorRegex.js" type="text/javascript" language="javascript"></script>

    <script src="/js/jqPlugins/onlypressnum.js" type="text/javascript" language="javascript"></script>

    <script src="/js/zfinput.js" type="text/javascript" language="javascript"></script>

    <script>

        $(function() {

            $.formValidator.initConfig({ formid: document.forms[0].id, onerror: function(msg) { alert(msg) } });

            $(".tbTitle").formValidator({ tipid: "tbTitleTip", onshow: "发布标题(至少8个字，请尽量包括关键信息以便搜索):", onfocus: "发布标题(至少8个字，请尽量包括关键信息以便搜索):", oncorrect: " ", onempty: "发布标题(至少8个字，请尽量包括关键信息以便搜索):" })
    .inputValidator({ min: 8, onerror: "输入错误：发布标题必须达到8个字以上" })
    .inputValidator({ max: 40, onerror: "输入错误：信息标题不能超过20个字" });


            $(".tbTopNum").onlypressnum();

            $(".tbContact").formValidator({ tipid: "tbContactTip", onshow: "( 如王先生)", onfocus: "( 如王先生)", oncorrect: " ", onempty: "( 如王先生)" })
    .inputValidator({ min: 1, onerror: "输入错误：必须输入联系人" });

            //         $(".tbPhone").formValidator({ tipid: "tbPhoneTip", onshow: "( 固话号码或手机号码，如果有多个用“，”分隔)", onfocus: "( 固话号码或手机号码，如果有多个用“，”分隔)", oncorrect: " ", onempty: "(  固话号码或手机号码，如果有多个用“，”分隔)" })
            //    .inputValidator({ min: 1, onerror: "输入错误：请至少输入一个联系电话" });

            $(".tbPrice").onlypressnum();
//            $(".tbEmail").formValidator({ tipid: "tbEmailTip", onshow: " ", onfocus: " ", oncorrect: " ", onempty: " " })
//    .regexValidator({ regexp: "email", datatype: "enum", onerror: "格式错误" });

        });
    
    
    </script>

    <div class="location mb10_">
        您现在的位置：<a href="/"><%=SiteInfo.Instance.SystemConfig.SiteName %></a> >> <a href="<%=this.Request.Url %>">
            信息发布</a>
    </div>
    <div class="editContainer">
        <table class=" w100_  edit ">
            <zf:TextBox ID="tbCity" class="dn_" Text="149" runat="server"></zf:TextBox>
            <zf:TextBox ID="tbArea" class="dn_" Text="153" runat="server"></zf:TextBox>
            <tbody>
                <tr>
                    <th colspan="4">
                        <div class="c">
                            分类信息发布
                        </div>
                    </th>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_"></span>范围：
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <input type="radio" checked="checked" value="1" id="areagz" name="areaType" /><label
                                for="areagz">广州地区</label>
                            <input type="radio" value="2" id="areagd" name="areaType" /><label for="areagd">省内城市</label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_">*</span> <span class="spCity">区域</span>
                        ：
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <select id="selCity" style="width: 100px;" class="mr10_">
                            </select>
                            <span id="spSQ"><span class="spArea">商圈</span>：<select id="selArea" class="ml10_"
                                style="width: 100px;"></select></span> <span class="zx_ dn_" id="Span1"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_">*</span>分类：
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <zf:DropDownList runat="server" ID="ddlType">
                            </zf:DropDownList>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_">*</span>信息标题：
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <zf:DropDownList runat="server" ID="ddlCompany">
                                <asp:ListItem Value="0">个人</asp:ListItem>
                                <asp:ListItem Value="1">公司</asp:ListItem>
                            </zf:DropDownList>
                            <zf:TextBox runat="server" ID="tbTitle" class="ltxt"></zf:TextBox>
                            <span class="zx_" id="tbTitleTip"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_">*</span>价格：
                        </div>
                    </td>
                    <td class="lr">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbPrice" class="sstxt"></zf:TextBox>
                            <span class="zx_" id="tbPriceTip">单位(元)，请输入整数。该项不填则为面议</span>
                        </div>
                    </td>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_"></span>有效天数：
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <zf:DropDownList runat="server" ID="ddlPeriod" class="dll">
                                <asp:ListItem Value="3" Text="3天"></asp:ListItem>
                                <asp:ListItem Value="7" Selected="True" Text="7天"></asp:ListItem>
                                <asp:ListItem Value="15" Text="15天"></asp:ListItem>
                                <asp:ListItem Value="30" Text="1个月"></asp:ListItem>
                                <asp:ListItem Value="90" Text="3个月"></asp:ListItem>
                            </zf:DropDownList>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_">*</span>内容：
                            <br />
                            (4000字之内)
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <zf:TextBox runat="server" TextMode="MultiLine" ID="tbContent" class="mltxt" Style="height: 200px;">
                        
                            </zf:TextBox>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c vam_">
                            <span class="xh_"></span>图片上传：
                            <br />
                            最多可上传5张图片<br />
                            图下必须<200kb
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <uc1:SWFUpLoad id="SWFUpLoad1" runat="server" uploadurl="/uploadfile.aspx?type=info"
                                filelimit="5" maxsize="500" filetype="*.gif;*.jpg" />
                            <zf:PlaceHolder ID="PlaceHolder1" runat="server" BindOper="Edit">
                                <zf:TextBox runat="server" ID="tbPhoto" class="dn_"></zf:TextBox>
                                <style>
                                    .ulimg li { float: left; width: 100px; margin-right: 10px; text-align: center; }
                                    .ulimg li img { width: 100px; height: 100px; }
                                </style>
                                <div class="ulimg">
                                    <zf:ListView runat="server" ID="lvImgList">
                                        <LayoutTemplate>
                                            <ul>
                                                <zf:PlaceHolder ID="itemPlaceHolder" runat="server">
                                                </zf:PlaceHolder>
                                            </ul>
                                        </LayoutTemplate>
                                        <ItemTemplate>
                                            <li>
                                                <img src="/photo/info/<%#Eval("File") %>" />
                                                <input type="button" onclick="DelPhoto(this,'<%#Eval("File") %>')" value="删除图片" />
                                            </li>
                                        </ItemTemplate>
                                    </zf:ListView>
                                </div>

                                <script>

                                    function DelPhoto(obj, file) {
                                        var result = $(".tbPhoto").val().replace(file, "");
                                        $(".tbPhoto").val(result);
                                        $(obj.parentNode).remove();
                                    }
                                </script>

                            </zf:PlaceHolder>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_"></span>标签：
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbTag" class="ltxt">
                            </zf:TextBox>
                            <span class="zx_" id="Span4">填写若干个相关标签可以让更多用户看到您发布的信息</span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_">*</span>联系人：
                        </div>
                    </td>
                    <td class="lr">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbContact" class="stxt"></zf:TextBox>
                            <span class="zx_" id="tbContactTip"></span>
                        </div>
                    </td>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_"></span>QQ：
                        </div>
                    </td>
                    <td class="lr">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbQQ" class="stxt"></zf:TextBox>
                            <span class="zx_" id="Span2">方便网友直接与您联系</span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_">*</span>电话：
                        </div>
                    </td>
                    <td class="lr">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbPhone" class="txt"></zf:TextBox>
                            <br />
                            <span class="zx_" id="tbPhoneTip">( 固话号码或手机号码，如果有多个用“，”分隔)</span>
                        </div>
                    </td>
                    <td class="rl">
                        <div class="c">
                            <span class="xh_"></span>邮箱：
                        </div>
                    </td>
                    <td class="rr">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbEmail" class="txt">
                            </zf:TextBox>
                            <span class="zx_" id="tbEmailTip"> </span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="ll">
                        <div class="c">
                            <span class="xh_"></span>地址：
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbAddress" class="mstxt" TextMode="MultiLine" Style="height: 30px;
                                width: 400px;"></zf:TextBox>
                            <span class="zx_" id="tbAddressTip"></span>
                        </div>
                    </td>
                </tr>
            </tbody>
            <tbody>
                <tr class="b">
                    <td colspan="4">
                        <div>
                            <zf:Button BindOper="AddNew" ID="btAdd" class="linkbtn addSubmit" runat="server"
                                Text=" 发 布 " OnClick="AddSubmit"></zf:Button>
                            <zf:Button BindOper="Edit" ID="btEdit" class="linkbtn" runat="server" Text=" 修 改 "
                                OnClick="EditSubmit"></zf:Button>
                            <input type="button" class="linkbtn" value=" 取 消 " onclick="GoBack();" />
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</asp:Content>
